package org.thirdHero.admin.config;

import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.thirdHero.admin.annotation.support.LoginAdminHandlerMethodArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.annotation.Resource;
import java.util.List;

/**
 * 注解添加token解析问题
 */
@EnableWebMvc
@Configuration
public class AdminConfig extends WebMvcConfigurerAdapter {
    @Resource
    private LoginAdminHandlerMethodArgumentResolver loginAdminHandlerMethodArgumentResolver;

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        super.addArgumentResolvers(argumentResolvers);
        argumentResolvers.add(loginAdminHandlerMethodArgumentResolver);
    }
}
